#include <iostream>
#include <string>
using namespace std;

bool isPalidrome(const string& s)
{
	if (s.size() <= 1) //Base case
		return true;
	else if (s[0] != s[s.size() - 1])	//Base case
		return false;
	else 
		return isPalidrome(s.substr(1, s.size() - 2));
}

int main()
{
	cout << "Enter a string: ";
	string s;
	getline(cin, s);

	if (isPalidrome(s))
		cout << s << " is a palindrome" << endl;
	else
		cout << s << " is not a palindrome" << endl;

	system("pause");
	return 0;
}

